<?php

namespace App\Admin\Forms\Collecter;

use App\Wen\Utils\Settings;
use Dcat\Admin\Contracts\LazyRenderable;
use Dcat\Admin\Traits\LazyWidget;
use Dcat\Admin\Widgets\Form;

class CollecterConfigForm extends Form implements LazyRenderable
{
    use LazyWidget;

    public function handle(array $input)
    {
        Settings::set('collecter_robot_bind_type', $input['collecter_robot_bind_type']);
        return $this->response()->success('配置成功')->refresh();
    }

    public function form()
    {
        $this->radio('collecter_robot_bind_type', '绑定类型')->help('例如：1:3代表 3个小红书账号绑定到同一个机器人')->options([1=>'1:1绑定', 2=>'1:2绑定', 3=>'1:3绑定'])->default(Settings::get('collecter_robot_bind_type', 1));
    }
}
